import React from 'react';
import { useHistory } from 'react-router';
import './style.scss'
const Index = (props) => {
  const { url, title, desc } = props
  const history = useHistory()
  return (
    <div onClick={ () => history.push({ pathname: '/detail', state: props }) }>
      <div>
        <img src={url} alt="" />
      </div>
      <div>
        <h3>{title}</h3>
        <p>{desc}</p>
      </div>
    </div>
  );
}

export default Index;
